<script setup lang="ts">
import { onMounted, ref } from "vue";
import { emitter } from '@/utils/eventBus'
type Props = {
    flag: boolean
}
defineProps<Props>()
const flag2 = ref<boolean>(false)

onMounted(() => {
    emitter.on('flag-meg', (e:boolean) => {
        console.log('emitter===', e)
        flag2.value  = e
    })
})

</script>

<template>
    <div class="B">我是B</div>
    <p>{{ flag }}</p>
    <p>{{ flag2 }}</p>
</template>

<style scoped lang="scss">
.B {
    background: red;
    color: #fff;
    width: 200px;
    height: 200px;
}
</style>
